class @SendMessageView extends PopUpView

    popUpId: "send-message"

    title: "Send message"   

    height: 250

    width: 480

    initialize: ->
        super
        @render()

    render: ->       
        @GetTemplate(SiteMap.Messages.SendMessageTemplate, (compiledTemplate) =>
            $(@el).html(compiledTemplate(@model.toJSON()))
        )
        
    events: 
        "click button.send": "sendMessage"

    sendMessage: (e) ->
        e.preventDefault()
        message = $(e.target).closest("form").find("fieldset input[type='text']").val()  
        @model.set("Message", message, {silent:true})
        @model.fetch()
       


